<?php
# !!!!!!!!!! DON'T MAKE ANY CHANGE IF YOU DON'T KNOW WHAT YOU'RE DOING !!!!!!!!!!
// --------------------------------------------------------------------------------------------------------------
// File Name              :	index.php
// Last Modification Time	:	2008-02-01 24:00
// Last Modified by       :	turker (turker.biz@gmail.com)
// list of modifications  :
//
//	- 2008-02-01 turker
//		* 24:00 file created.
//
// --------------------------------------------------------------------------------------------------------------
ob_start();
session_start();

# include required files - start
require_once('inc/config.php');
require_once('inc/classes.php');
require_once('inc/functions.php');
# include required files - end

# run main functions and classes
$mysql=new Mysql(); # connect to mysql server
$valid=new Validation();
$prep=new Prepare();

if (@!$_SESSION['logged']||$_SESSION['logged']!=1) $_SESSION['logged']=0; # check login
setLanguage(); # set site language
loadSettings(); # load site settings
# /run main functions and classes

# run modules
$hook=new programHook();
$hook->loadModules();
# /run modules


# display requested page - start

$page=@trim($_GET['page']); # get requested page
# check page start
if (empty($page)||!$page) $page='homepage';
if (!in_array($page,$PAGES)) $page='404';
# check page end

if ($page!='ajax') {
  require_once("template/header.php");
  require_once("template/sidebar.php");
  require_once("template/$page.php");
  require_once("template/footer.php");
}
else {
  require_once("template/$page.php");
}

# display requested page - end

$mysql->destructor(); # close mysql server connection
ob_end_flush();
?>